﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<table cellpadding="0" cellspacing="0" style="width:100%" >
    <tr>
		<td style="background-image:url(../../Content/Images/Admin/backgr.gif); height:60px; text-align:center">
            <a href="<%= Url.Action("Index", "Home") %>" style="text-decoration: none;">
                <span style="color: #cc0000; font-size: 25px; font-weight: bold; "><%= WebConfiguration.SiteName %></span>
            </a>
        </td>
	</tr>
	<tr>
		<td style="height:1px; background-color:#484883"></td>
	</tr>
                		
	<tr>
		<td style="vertical-align:top; padding:0px;">
			<%--<div id="lefttreeholder" class="dtree" style="width:300px; height:300px; margin:2px 0 0 5px; overflow:auto">
			<div style="width:600px">--%>
			<div style="margin:5px;">

				<script type="text/javascript">
					//<!--
					//<%--(id, pid, name, url, title, target, icon, iconOpen, open) --%>
					d = new dTree('d');
					d.add(0, -1, ' Administration&nbsp;(<a href="javascript: d.openAll();"><u>expand all</u></a>&nbsp;<a href="javascript: d.closeAll();"><u>collapse all</u></a>)');
                    d.add(5, 0, 'Tổ chức cá nhân', '../Admin/SelectToChucCaNhan');
                    d.add(2, 0, 'Danh mục chính', '../Admin/SelectDanhMucChinh');
                    <% 
                       var lstDanhMucChinh = Model.DanhMucChinhModel.GetModel.LstObjModel;
                       for (int i = 0; i < lstDanhMucChinh.Count; i++){ %>
                        d.add(2<%= i %>, 2, '<%= lstDanhMucChinh[i].TenDanhMucChinh %>', '../../Admin/SelectDanhMucConByIDDanhMucChinh?iddanhmucchinh=<%= lstDanhMucChinh[i].ID %>'); 
                        <%
                            var lstDanhMucCon = lstDanhMucChinh[i].DanhMucCon.ToList();
                            for (int j = 0; j < lstDanhMucCon.Count; j++){
                         %>
                            d.add(2<%= i %><%= j %>, 2<%=i %>, '<%= lstDanhMucCon[j].TenDanhMucCon %>', ''); 
                         <% } %>
                    <% } %>
                    d.add(4, 0, 'Quản lý sản phẩm', '');
                    <% 
                       lstDanhMucChinh = Model.DanhMucChinhModel.GetModel.LstObjModel;
                       for (int i = 0; i < lstDanhMucChinh.Count; i++){ %>
                        d.add(4<%= i %>, 4, '<%= lstDanhMucChinh[i].TenDanhMucChinh %>', ''); 
                        <%
                            var lstDanhMucCon = lstDanhMucChinh[i].DanhMucCon.ToList();
                            for (int j = 0; j < lstDanhMucCon.Count; j++){
                         %>
                            d.add(4<%= i %><%= j %>, 4<%=i %>, '<%= lstDanhMucCon[j].TenDanhMucCon %>', '../../Admin/SelectSanPhamByIDDanhMucCon?iddanhmuccon=<%= lstDanhMucCon[j].ID %>'); 
                         <% } %>
                    <% } %>
                    d.add(1, 0, 'Xem các phiên', '');
					<% 
                       lstDanhMucChinh = Model.DanhMucChinhModel.GetModel.LstObjModel;
                       for (int i = 0; i < lstDanhMucChinh.Count; i++){ %>
                        d.add(1<%= i %>, 1, '<%= lstDanhMucChinh[i].TenDanhMucChinh %>', ''); 
                        <%
                            var lstDanhMucCon = lstDanhMucChinh[i].DanhMucCon.ToList();
                            for (int j = 0; j < lstDanhMucCon.Count; j++){
                         %>
                            d.add(1<%= i %><%= j %>, 1<%=i %>, '<%= lstDanhMucCon[j].TenDanhMucCon %>', '../../Admin/SelectPhienDauGiaByIDDanhMucCon?iddanhmuccon=<%= lstDanhMucCon[j].ID %>'); 
                         <% } %>
                    <% } %>
                    d.add(6, 0, 'Hướng dẫn', '../Admin/SelectHuongDan');
                    d.add(7, 0, 'Hộp thư', '../Admin/SelectHopThu');
                <% if("SUPERADMIN".Equals(Roles.GetRolesForUser(Page.User.Identity.Name)[0].ToUpper()))
                   { %>
                    d.add(122222, 0, 'Người dùng', '../Admin/SelectNguoiDung?role=<%= Roles.GetRolesForUser(Page.User.Identity.Name)[0] %>');
                <% } %>

					d.config.useLines = true;
					document.write(d);
					//d.openAll();
					//-->
				</script>
                
			</div>
                					
		</td>
		<td style="background-image:url(../../Content/Images/Admin/backgr.gif); height: 23px;"></td>
	</tr>
</table>
